import Vue from "vue"
import Vuex from "vuex"
import $util from '@/common/sort.js'

let data = {
	state: {
		keyword:'',
		lastuse:[],
		chooseItem:{},
		isIframe:false,
		searchList:[],
		management:[
			{
				name: '风巽',
				cover: require('@/assets/images/all_png/glgj/fs.png'),
				link: 'http://www.baidu.com',
				isBig:false
			},
			{
				name: 'WT服务器远程登录监控',
				cover:require('@/assets/images/all_png/glgj/wt.png'),
				link: 'http://dishaxy.com/doc/4/docnav/366',
				isBig:false
			}, 
			{
				name: 'GitLab',
				cover: require('@/assets/images/all_png/glgj/git.png'),
				link: 'https://www.baidu.com/s?ie=UTF-8&wd=~%20%E9%80%89%E6%8B%A9%E7%AC%A6',
				isBig:false
			}, 
			{
				name: 'Confluence',
				cover: require('@/assets/images/all_png/glgj/co.png'),
				link: 'https://element.eleme.cn/#/zh-CN/component/message',
				isBig:false
			}, 
			{
				name: 'jenkins',
				cover: require('@/assets/images/all_png/glgj/jen.jpg'),
				link:'http://www.baidu.com',
				isBig:false
			}, 
			{
				
				name: 'DOClever在线文档',
				cover: require('@/assets/images/all_png/glgj/doc.jpg'),
				link: 'http://www.baidu.com',
				isBig:false
			},
			{
				name: '研发jira流程入口',
				cover: require('@/assets/images/all_png/glgj/yjira.png'),
				link: 'http://www.baidu.com',
				isBig:false
			}, 
			{
				name: 'jira',
				cover: require('@/assets/images/all_png/glgj/jir.png'),
				link: 'http://www.baidu.com',
				isBig:false
			}, 
		],
		MacroLocation:[
			{
				  name: 'Investa',
				  cover: require('@/assets/images/all_png/hgxz/i.png'),
				  link: 'http://www.baidu.com',
				  isBig:false
			},
			{
				my_code: require('@/assets/images/qr-code/freemeso-android.png'),
				name: 'Freemeso 安卓APP',
				cover: require('@/assets/images/all_png/APPsc/1/f.png'),
				link: 'http://www.baidu.com',
				detail: '请扫描二维码体验软件',
				isBig:false,
				button:true,
				buttonData:'扫一扫'
          },
		  {
				my_code: require('@/assets/images/qr-code/freemeso-ios.png'),
				name: 'Freemeso IOS APP',
				cover: require('@/assets/images/all_png/APPsc/1/f.png'),
				link: 'http://www.baidu.com',
				detail: '请扫描二维码体验软件',
				isBig:false,
				button:true,
				buttonData:'扫一扫'
          }
		],
		anemometry:[
			 {
			  name: '中尺度数据下载',
			  cover: require('@/assets/images/all_png/cf/z.png'),
			  link: 'http://www.baidu.com',
			  isBig:false,
			},{
			  name: 'GoldLink',
			  cover: require('@/assets/images/all_png/cf/g.png'),
			  link: 'http://www.baidu.com',
			  isBig:false,
			}
		],
		mapDeal: [
		  {
		    
		    name: '风匠',
		    cover: require('@/assets/images/all_png/dtcl/f.png'),
		    link: 'http://www.baidu.com',
			isBig:false,
		    
		  }, {
		    
		    name: '坐标转换',
		    cover: require('@/assets/images/all_png/dtcl/z.png'),
		    link: 'http://www.baidu.com',
			isBig:false,
		  
		  }
		],
		modeTrue: [
		  {
		    name: 'WU-软件安装包',
		    cover: require('@/assets/images/all_png/fz/f.png'),
			isBig:false,
		    link: 'http://www.baidu.com',
			button:true,
			buttonData:'下载',
			type:1,
			
		  }
		],
		effImp: [
		  {
		    
		    name: '环境影响评估',
		    cover: require('@/assets/images/all_png/hcl/h.png'),
		    link: 'http://www.baidu.com',
			isBig:false,
		  }, {
		    
		    name: '不确定度计算工具',
		    cover: require('@/assets/images/all_png/hcl/bq.png'),
		    link: 'http://www.baidu.com',
		    isBig:false,
		  }, {
		    
		    name: '第二版IEC载荷参数提取',
		    cover: require('@/assets/images/all_png/hcl/i.png'),
		    link: 'http://www.baidu.com',
		    isBig:false,
		  }, {
		    
		    name: '报告自动生成',
		    cover: require('@/assets/images/all_png/hcl/b.png'),
		    link: 'http://www.baidu.com',
		    isBig:false,
		  }, {
		    
		    name: '第三版IEC载荷参数提取',
		    cover: require('@/assets/images/all_png/hcl/i.png'),
		    link: 'http://www.baidu.com',
		    isBig:false,
		  }, {
		    name: '第三版IEC载荷扇区管理工具',
		    cover: require('@/assets/images/all_png/hcl/i.png'),
		    link: 'http://www.baidu.com',
		    isBig:false,
		  }
		],
		latterEnva: [
		  {
		    
		    name: '自由流扇区计算',
		    cover: require('@/assets/images/all_png/hpg/z.png'),
		    link: 'http://www.baidu.com',
		    isBig:false,
		  },
		  {
		    
		    name: 'Resmart',
		    cover: require('@/assets/images/all_png/hpg/r.jpg'),
		    link: 'http://www.baidu.com',
		    isBig:false,
		  }
		],
		postEva: [
		  {
		    name: '海上风电经济性评价计算工具',
		    cover: require('@/assets/images/all_png/xltsjj/h.png'),
		    link: 'http://www.baidu.com',
		    isBig:false
		  },
		  {
		    name: '风资源速算',
		    cover: require('@/assets/images/all_png/xltsjj/f.png'),
		    link: 'http://www.baidu.com',
			isBig:false
		  }, {
		    
		    name: '金风快传',
		    cover: require('@/assets/images/all_png/xltsjj/j.png'),
		    link: 'http://www.baidu.com',
		    isBig:false
		  }, {
		    
		    name: '功率曲线查询系统',
		    cover: require('@/assets/images/all_png/xltsjj/g.png'),
		    link: 'http://www.baidu.com',
		    isBig:false
		  }, {
		    
		    name: '陆上风电项目经济性评价工具',
		    cover: require('@/assets/images/all_png/xltsjj/l.png'),
		    link: 'http://www.baidu.com',
		    isBig:false
		  }
		],
		dataService: [
		  {
		    
		    name: '风资源数据服务网关',
		    cover: require('@/assets/images/all_png/sjfw/f.png'),
		    link: 'http://www.baidu.com',
		    isBig:false
		  }, {
		    
		    name: '中尺度数据下载',
		    cover: require('@/assets/images/all_png/sjfw/z.png'),
		    link: 'http://www.baidu.com',
		    isBig:false
		  }
		],
		qr_code1: [
		  {
		    my_code: require('@/assets/images/qr-code/jfkjgzpt.jpg'),
		    name: '金风科技公众平台',
		    cover: require('@/assets/images/all_png/APPsc/1/j.png'),
		    link: 'http://www.baidu.com',
		    detail: '请扫描二维码关注平台',
			isBig:false,
			button:true,
			buttonData:'扫一扫'
		  }, 
		  {
				my_code: require('@/assets/images/qr-code/freemeso-android.png'),
				name: 'Freemeso 安卓APP',
				cover: require('@/assets/images/all_png/APPsc/1/f.png'),
				link: 'http://www.baidu.com',
				detail: '请扫描二维码体验软件',
				isBig:false,
				button:true,
				buttonData:'扫一扫'
          },
		  {
				my_code: require('@/assets/images/qr-code/freemeso-ios.png'),
				name: 'Freemeso IOS APP',
				cover: require('@/assets/images/all_png/APPsc/1/f.png'),
				link: 'http://www.baidu.com',
				detail: '请扫描二维码体验软件',
				isBig:false,
				button:true,
				buttonData:'扫一扫'
          },
		  {
		    
		    name: '风的力量',
		    my_code: require('@/assets/images/qr-code/fdll.jpg'),
		    cover: require('@/assets/images/all_png/APPsc/1/j.png'),
		    link: 'http://www.baidu.com',
		    detail: '请扫描二维码关注平台',
			isBig:false,
			button:true,
			buttonData:'扫一扫'
		  }, 
		  {
		   
		    name: '金风科技微平台',
		    my_code: require('@/assets/images/qr-code/jfkjwpt.jpg'),
		    cover: require('@/assets/images/all_png/APPsc/1/j.png'),
		    link: 'http://www.baidu.com',
		    detail: '请扫描二维码关注平台',
			isBig:false,
			button:true,
			buttonData:'扫一扫'
		  },
		],
		qr_code2: [
		  
		  {
		    
		    name: 'Windpro',
		    cover: require('@/assets/images/all_png/APPsc/2/wi.png'),
		    link: 'http://www.baidu.com',
			isBig:false,
			button:true,
			type:1,
			buttonData:'下载'
		  },
		  
		  {
		    
		    name: 'NRG数据软件',
		    cover: require('@/assets/images/all_png/APPsc/2/n.png'),
		    link: 'http://www.baidu.com',
			isBig:false,
			button:true,
			type:1,
			buttonData:'下载'
		  }
		
		],
		
	},
	getters: {
		
	},
	mutations: {
		mouseEnter(state,{dataName,index}){
			state[dataName][index].isBig=true
		},
		mouseLeave(state,{dataName,index}){
			state[dataName][index].isBig=false
		},
		changeSerachList(state,item){
			state.searchList=item
		},
		sortSearchList(state){
			state.searchList.sort($util.compare('index')).reverse().splice(10)
		},
		setItem(state,{bool,item}){
			
			state.isIframe=bool
			state.chooseItem = item
		},
		setLastuse(state,item){
			state.lastuse.unshift(item)
			sessionStorage.setItem('lastuse',JSON.stringify(state.lastuse))
		},
		clearLastuse(state){
			state.lastuse=[]
			sessionStorage.removeItem('lastuse')
		},
		
		getLastuse(state){
			state.lastuse = sessionStorage.getItem('lastuse')?JSON.parse(sessionStorage.getItem('lastuse')):[]
			
		},
		clearKeyword(state){
			state.keyword=''
			
		},
		setKeyword(state,word){
			state.keyword=word
			
		},
		
		
		
	},
	actions: {
		clickSortLastuse({state,commit},{item,index}){
		
			state.lastuse.splice(index,1)
			
			commit('setLastuse',item)
		},
		
	}
}

Vue.use(Vuex)

export default new Vuex.Store({
  ...data
})
